package dbs

import (
	"go.uber.org/zap"
	"yundian/internel/pkg/dingo/global"
)

var err error

type MysqlComponent struct {
	cfg *global.MysqlConfig
}

func NewMysqlComponent() *MysqlComponent {
	return &MysqlComponent{cfg: global.Cfg.Mysql}
}

func (m *MysqlComponent) Step() {
	global.Orm,err = GormDB(m.cfg)
	if err != nil {
		zap.L().Fatal("Mysql 连接初始化失败",zap.Error(err))
	}
}
